<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 100px;
            height: 100px;
            align-items: center;
        }
    </style>
</head>
<body>
    <div class="box">
        淘宝二维码
        <p>x</p>
        <img src="./二维码.png" alt=""/>
    </div>
    <script>
        let x = document.querySelector('p');
        let box = document.querySelector('.box');
        
        x.onclick=function(){
            box.style.display = 'none';//隐藏
            box.remove()//删除
        }
        
    </script>
</body>
</html>